package GUI;

import java.awt.EventQueue;
import java.awt.Graphics;
import java.awt.Image;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

public class Alarm extends JFrame
{
  private JPanel contentPane;
  private Image img;

  public static void main(String[] args)
  {
    EventQueue.invokeLater(new Runnable() {
      public void run() {
        try {
          Alarm frame = new Alarm();
          frame.setVisible(true);
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    });
  }

  public Alarm()
  {
    setDefaultCloseOperation(3);
    setBounds(100, 100, 840, 640);
    this.contentPane = new JPanel() {
      public void paintComponent(Graphics g) {
    	  Image image2 = new ImageIcon("alarm2.png").getImage();
          g.drawImage(image2, 0, 0, this);
    	  /* while(true){
        Image image = new ImageIcon("alarm.png").getImage();
        g.drawImage(image, 0, 0, this);
        Image image2 = new ImageIcon("alarm2.png").getImage();
        g.drawImage(image2, 0, 0, this);
    	  }*/
      }
    };
    this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
    setContentPane(this.contentPane);
    this.contentPane.setLayout(null);

    JPanel panel_1 = new JPanel();
    panel_1.setOpaque(false);
    panel_1.setBounds(200, 268, 450, 200);
    this.contentPane.add(panel_1);
    panel_1.setLayout(null);

    String curDate = new SimpleDateFormat("yyyyMMddhhmmss").format(new Date());

    JLabel lblCurrentTime = new DigitalClock();
    lblCurrentTime.setBounds(197, 35, 125, 38);
    panel_1.add(lblCurrentTime);

    JLabel lblNextMeeting = new JLabel("GetNextMeeting");
    lblNextMeeting.setBounds(197, 83, 200, 50);
    panel_1.add(lblNextMeeting);

    JButton btnConfirm = new JButton("Confirm") {
      public void paintComponent(Graphics g) {
        Image image = new ImageIcon("iconconfirm.png").getImage();
        g.drawImage(image, 0, 0, this);
      }
    };
    btnConfirm.setBorder(null);
    btnConfirm.setBounds(200, 478, 220, 40);
    this.contentPane.add(btnConfirm);

    JButton btnSnooze = new JButton("Snooze") {
      public void paintComponent(Graphics g) {
        Image image = new ImageIcon("iconsnooze.png").getImage();
        g.drawImage(image, 0, 0, this);
      }
    };
    btnSnooze.setBorder(null);
    btnSnooze.setBounds(430, 478, 220, 40);
    this.contentPane.add(btnSnooze);
  }
}